file(GLOB_RECURSE halCode
    ${platformHalDir}/Src/${platformSeries}_hal.c
    ${platformHalDir}/Src/${platformSeries}_hal_cortex.c
    ${platformHalDir}/Src/${platformSeries}_hal_gpio.c
    ${platformHalDir}/Src/${platformSeries}_hal_gpio_ex.c
    ${platformHalDir}/Src/${platformSeries}_hal_uart.c
    ${platformHalDir}/Src/${platformSeries}_hal_rcc.c
    ${platformHalDir}/Src/${platformSeries}_hal_rcc_ex.c
    ${platformHalDir}/Src/${platformSeries}_hal_pwr.c
    ${platformHalDir}/Src/${platformSeries}_hal_dma.c
)
addprefix(${platformHalDir}/Src/${platformSeries}_hal_ hal_extraFile)
list(APPEND halCode ${hal_extraFile})
add_library(hal STATIC ${halCode})
target_include_directories(
    hal PUBLIC
    ${platformDir}
    ${platformHalDir}/Inc
    ${platformHalDir}/Inc/Legacy
    ${platformCMSISDir}/Include
    ${PROJECT_SOURCE_DIR}/Project/${PROJECTNAME}/dev/inc
    ${PROJECT_SOURCE_DIR}/Drivers/CMSIS/Include
)
target_compile_definitions(
    hal PUBLIC
    -DUSE_HAL_DRIVER
)
